package zuoye01;

public class Student  extends  Person {
    int no;
    double scoreEn;
    double scoreMa;
    double scoreCh;


    @Override
    public String toString() {
        return "Student{" +
                "no=" + no +
                ", scoreEn=" + scoreEn +
                ", scoreMa=" + scoreMa +
                ", scoreCh=" + scoreCh +
                ", name='" + name + '\'' +
                ", sex='" + sex + '\'' +
                ", age=" + age +
                '}';
    }

    {
    }

    public double avg (){
        double avg =(scoreCh+scoreMa+scoreEn)/3;
        System.out.println(name+"平均分"+avg);
        return avg;
    }

    public double max(){
        double max =Math.max(scoreCh,Math.max(scoreMa,scoreEn));
        System.out.println(name+"最高分"+max);
        return max;


    }
    public double min(){
        double min =Math.min(scoreCh,Math.min(scoreMa,scoreEn));
        System.out.println(name+"最低分"+min);
        return min;
    }
}
